import java.util.concurrent.ConcurrentHashMap;

public class UserManager {
    // 使用线程安全的 Map 存储用户数据（用户名 -> 密码）
    private static final ConcurrentHashMap<String, String> users = new ConcurrentHashMap<>();

    public static void addUser(String username, String password) {
        users.put(username, password);
    }

    public static boolean userExists(String username) {
        return users.containsKey(username);
    }

    public static boolean validateUser(String username, String password) {
        return users.getOrDefault(username, "").equals(password);
    }
}